

docker stop jenkins && docker rm jenkins
docker run -itd --name jenkins --privileged=true -u root --hostname jenkins --restart always -p 8080:8080 -p 50000:50000 -e TZ=Asia/Shanghai \
 -v /mnt/software/jenkins/data:/var/jenkins_home \
 -v /usr/bin/docker:/usr/bin/docker \
 -v /var/run/docker.sock:/var/run/docker.sock \
 -v /root/.m2:/root/.m2 \
 -v /root/.ssh:/root/.ssh \
 -v /opt/software/apache-maven-3.9.5:/var/apache-maven-3.9.5 \
 -v /opt/software/jdk1.8.0_391:/var/jdk1.8.0_391 \
 -v /opt/software/jdk-17.0.9:/var/jdk-17.0.9 \
 -v /opt/software/jdk-21.0.2:/var/jdk-21.0.2 \
 -v /opt/software/node-v20.15.0-linux-x64:/var/node-v20.15.0-linux-x64 \
 registry.cn-hangzhou.aliyuncs.com/mrzhou1553/jenkins:2.464-jdk17
docker logs -f -n 100 jenkins


function install_plugins() {
    echo '需要安装： Maven Integration、Pipeline、Git、'
}

export MAVEN_HOME=/opt/software/apache-maven-3.9.5
export JAVA_HOME=/opt/software/jdk1.8.0_391
export JAVA8_HOME=/opt/software/jdk1.8.0_391
export JAVA17_HOME=/opt/software/jdk-17.0.9
export JAVA21_HOME=/opt/software/jdk-21.0.2
export PATH=$PATH:$MAVEN_HOME/bin:$JAVA_HOME/bin



